package com.ruoyi.demo.controller;

import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.demo.DTO.CreateUserMeetDetailsDTO;
import com.ruoyi.demo.service.ICreateUserMeetDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo/createUserMeetDetails")
public class CreateUserMeetDetailsController {
    @Autowired
    private ICreateUserMeetDetailsService meetService;

    // 根据 meet_id 获取会议详情
    @GetMapping("/{meetId}")
    public ResponseEntity<CreateUserMeetDetailsDTO> getMeetDetails(@PathVariable("meetId") Long meetId) {
        CreateUserMeetDetailsDTO meetDetails = meetService.getMeetDetails(meetId);
        if (meetDetails != null) {
            return ResponseEntity.ok(meetDetails);
        } else {
            return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
        }
    }
}
